let brtop3span = document.querySelector(".brtop3 .brtop3span")
let vxacount = document.querySelector(".brtop3 .vxacount")
brtop3span.onmouseover = function () {
    vxacount.classList.add("he142")
}
brtop3span.onmouseout = function () {
    vxacount.classList.remove("he142")
}

let data = [
    { "count": 4000, "price": 1200, "unitPrice": "0.3000" },
    { "count": 8000, "price": 2000, "unitPrice": "0.2500" },
    { "count": 40000, "price": 8000, "unitPrice": "0.2000" }
]

let infoBtn = document.querySelector(".frequence")

data.forEach(function (v, i) {
    infoBtn.innerHTML += `<span class="frespan">${v.count}次</span>`
})

let freArr = document.querySelectorAll(".frespan")
let infoText = document.querySelector(".info-text")

freArr[0].classList.add("active")
freArr.forEach(function (v, i) {
    v.onclick = function () {
        freArr.forEach(function (v2, i2) {
            v2.classList.remove("active")
        })
        v.classList.add("active")

        infoText.innerHTML = `                        
        <span class="infotext-price">￥${data[i].price}</span>
        <span>(约${data[i].unitPrice}元/次)，仅限企业实名购买</span>
        `
    }
})

let deBtnArr = document.querySelectorAll(".chioce-type button")
let conArr = document.querySelectorAll(".con")

deBtnArr[0].classList.add("active2")
conArr[0].classList.add("con1")
deBtnArr.forEach(function (v,i){
    v.onclick = function (){
        deBtnArr.forEach(function (v2,i2){
            v2.classList.remove("active2")
        })
        conArr.forEach(function (v3,i3){
            v3.style.display = "none"
        })
        v.classList.add("active2")
        conArr[i].style.display = "block"
    }
})